package com.hxl.app.controller;


import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hxl.app.R;
import com.hxl.config.LogAnnotation;
import com.hxl.entity.CmfzBanner;
import com.hxl.mapper.CmfzBannerMapper;
import com.hxl.service.CmfzBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * <p>
 * InnoDB free: 10240 kB 前端控制器
 * </p>
 *
 * @author hxl
 * @since 2020-08-18
 */
@RestController
@RequestMapping("/app/ban")
public class BannerController {
    @Autowired
    private CmfzBannerMapper mapper;
    @GetMapping("selectBanner/{size}")
    public R selectBanners(@PathVariable("size") Integer size){

        List<CmfzBanner> query = mapper.selectList(null);

        if(query!=null){
            return R.ok().put("data",query);
        }

        return R.error(1005,"轮播图查询失败");
    }


}
